using UnityEngine;

public class MapViewClound : MonoBehaviour
{
	private float minX = -2400f;

	private float maxX = 2400f;

	private float minY = 1280f;

	private float maxY = 1500f;

	private float curX;

	private float curY;

	private float speed;

	private void Start()
	{
		RandomParams();
		curX = Random.Range(minX, maxX);
		((RectTransform)base.transform).anchoredPosition = new Vector3(curX, curY);
	}

	private void RandomParams()
	{
		curY = Random.Range(minY, maxY);
		curX = maxX;
		speed = Random.Range(20, 40);
	}

	private void Update()
	{
		curX -= Time.deltaTime * speed;
		if (curX < minX)
		{
			RandomParams();
		}
		((RectTransform)base.transform).anchoredPosition = new Vector3(curX, curY);
	}
}
